package com.leanin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.leanin.domain.CommonRulesInfo;
import com.leanin.domain.RulesInfo;

public interface RulesInfoMapper {

	/**
	 * 查询共享规则信息
	 * @param rulesType
	 * @param rulesName
	 * @return
	 */
	List<CommonRulesInfo> findCommonRules(@Param("rulesType") Integer rulesType,@Param("rulesName") String rulesName);
	/**
	 * 查询规则列表信息
	 * @param rulesName
	 * @param type
	 * @return
	 */
	List<RulesInfo> findRulesList(@Param("rulesName") String rulesName,@Param("type") Integer type,@Param("typeId") Long typeId);
	
	/**
	 * 根据院区编码查询共享列表信息
	 * @param wardCode
	 * @param rulesType
	 * @param rulesName
	 * @return
	 */
	List<RulesInfo> findRulesByWardCode(@Param("wardCode") String wardCode,@Param("rulesType") Integer rulesType,@Param("rulesName") String rulesName);
	/**
	 * 修改规则状态
	 * @param rulesInfoId
	 * @param status
	 * @return
	 */
    int updateRulesState(@Param("rulesInfoId") Long rulesInfoId,@Param("status") Integer status);

    /**
     * 增加规则信息
     * @param record
     * @return
     */
    int addRulesInfo(RulesInfo record);

    /**
     * 根绝ID查规则信息
     * @param rulesInfoId
     * @return
     */
    RulesInfo findRulesById(@Param("rulesInfoId") Long rulesInfoId);

    /**
     * 根据规则名称查询规则信息
     * @param rulesName
     * @return
     */
    RulesInfo findRulesByName(@Param("rulesName") String rulesName);
    /**
     * 编辑规则信息
     * @param record
     * @return
     */
    int updateRulesInfo(RulesInfo record);
    
}